# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V4.Model.TargetingTemplate do
  @moduledoc """
  Contains properties of a targeting template. A targeting template encapsulates targeting information which can be reused across multiple ads.

  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Account ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert.
  *   `advertiserId` (*type:* `String.t`, *default:* `nil`) - Advertiser ID of this targeting template. This is a required field on insert and is read-only after insert.
  *   `advertiserIdDimensionValue` (*type:* `GoogleApi.DFAReporting.V4.Model.DimensionValue.t`, *default:* `nil`) - Dimension value for the ID of the advertiser. This is a read-only, auto-generated field.
  *   `dayPartTargeting` (*type:* `GoogleApi.DFAReporting.V4.Model.DayPartTargeting.t`, *default:* `nil`) - Time and day targeting criteria.
  *   `geoTargeting` (*type:* `GoogleApi.DFAReporting.V4.Model.GeoTargeting.t`, *default:* `nil`) - Geographical targeting criteria.
  *   `id` (*type:* `String.t`, *default:* `nil`) - ID of this targeting template. This is a read-only, auto-generated field.
  *   `keyValueTargetingExpression` (*type:* `GoogleApi.DFAReporting.V4.Model.KeyValueTargetingExpression.t`, *default:* `nil`) - Key-value targeting criteria.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplate".
  *   `languageTargeting` (*type:* `GoogleApi.DFAReporting.V4.Model.LanguageTargeting.t`, *default:* `nil`) - Language targeting criteria.
  *   `listTargetingExpression` (*type:* `GoogleApi.DFAReporting.V4.Model.ListTargetingExpression.t`, *default:* `nil`) - Remarketing list targeting criteria.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of this targeting template. This field is required. It must be less than 256 characters long and unique within an advertiser.
  *   `subaccountId` (*type:* `String.t`, *default:* `nil`) - Subaccount ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert.
  *   `technologyTargeting` (*type:* `GoogleApi.DFAReporting.V4.Model.TechnologyTargeting.t`, *default:* `nil`) - Technology platform targeting criteria.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :advertiserId => String.t() | nil,
          :advertiserIdDimensionValue => GoogleApi.DFAReporting.V4.Model.DimensionValue.t() | nil,
          :dayPartTargeting => GoogleApi.DFAReporting.V4.Model.DayPartTargeting.t() | nil,
          :geoTargeting => GoogleApi.DFAReporting.V4.Model.GeoTargeting.t() | nil,
          :id => String.t() | nil,
          :keyValueTargetingExpression =>
            GoogleApi.DFAReporting.V4.Model.KeyValueTargetingExpression.t() | nil,
          :kind => String.t() | nil,
          :languageTargeting => GoogleApi.DFAReporting.V4.Model.LanguageTargeting.t() | nil,
          :listTargetingExpression =>
            GoogleApi.DFAReporting.V4.Model.ListTargetingExpression.t() | nil,
          :name => String.t() | nil,
          :subaccountId => String.t() | nil,
          :technologyTargeting => GoogleApi.DFAReporting.V4.Model.TechnologyTargeting.t() | nil
        }

  field(:accountId)
  field(:advertiserId)
  field(:advertiserIdDimensionValue, as: GoogleApi.DFAReporting.V4.Model.DimensionValue)
  field(:dayPartTargeting, as: GoogleApi.DFAReporting.V4.Model.DayPartTargeting)
  field(:geoTargeting, as: GoogleApi.DFAReporting.V4.Model.GeoTargeting)
  field(:id)

  field(:keyValueTargetingExpression,
    as: GoogleApi.DFAReporting.V4.Model.KeyValueTargetingExpression
  )

  field(:kind)
  field(:languageTargeting, as: GoogleApi.DFAReporting.V4.Model.LanguageTargeting)
  field(:listTargetingExpression, as: GoogleApi.DFAReporting.V4.Model.ListTargetingExpression)
  field(:name)
  field(:subaccountId)
  field(:technologyTargeting, as: GoogleApi.DFAReporting.V4.Model.TechnologyTargeting)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V4.Model.TargetingTemplate do
  def decode(value, options) do
    GoogleApi.DFAReporting.V4.Model.TargetingTemplate.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V4.Model.TargetingTemplate do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
